printing: Use correct units for margins taken via IPP
authorMarek Kasik <mkasik@redhat.com>
Fri, 20 Feb 2015 11:22:26 +0000 (12:22 +0100)
committerMarek Kasik <mkasik@redhat.com>
Fri, 20 Feb 2015 11:27:12 +0000 (12:27 +0100)
cups_printer_get_hard_margins() returned margins in millimeters
for margins taken via IPP request instead of Units used before.

modules/printbackends/cups/gtkprintbackendcups.c

index 15546f7189d9632f72dec6798dc9e9fcd9c26c26..6777673d80ea43ed0586ecefd6f9851346baea41 100644 (file)
@@ -6424,10 +6424,10 @@ cups_printer_get_hard_margins (GtkPrinter *printer,
     }
   else if (cups_printer->media_margin_default_set)
     {
-      *left = cups_printer->media_left_margin_default;
-      *bottom = cups_printer->media_bottom_margin_default;
-      *right = cups_printer->media_right_margin_default;
-      *top = cups_printer->media_top_margin_default;
+      *left = POINTS_PER_INCH * cups_printer->media_left_margin_default / MM_PER_INCH;
+      *bottom = POINTS_PER_INCH * cups_printer->media_bottom_margin_default / MM_PER_INCH;
+      *right = POINTS_PER_INCH * cups_printer->media_right_margin_default / MM_PER_INCH;
+      *top = POINTS_PER_INCH * cups_printer->media_top_margin_default / MM_PER_INCH;
       result = TRUE;
     }